<? include "./pc/view/header.inc.htm"; ?>

<div class="panel width" id="threadlist_panel">
	<div class="header">
		<table class="layout">
			<tr>
				<td>
					<? if($order == 'tid') { ?>最新主题<? } ?>
					<? if($order == 'lastpid') { ?>最新回复<? } ?>
					<? if($order == 'agrees') { ?>最多赞同<? } ?>
				</td>
				<td id="threadlist_orderby" align="right" class="normal">
					<span class="grey">排序：</span>							
					<a href="index-lastpid.htm" nofollow <?=($order == 'lastpid' ? ' class="active"' : '')?>><span class="icon comments" title="回帖时间"></span>回帖时间</a>
					<a href="index-tid.htm" nofollow <?=($order == 'tid' ? ' class="active"' : '')?>><span class="icon comment" title="发帖时间"></span>发帖时间</a>
				</td>
			</tr>
		</table>
	</div>
	<div class="body">
		<div id="threadlist">
			<? include "./pc/view/thread_list_body.inc.htm"; ?>
		</div>
	</div>
</div>	

<? if(forum_is_mod($fid, $gid, $uid)) { ?>
<dl class="row margin">
	<dt class="right col-6">
		<button class="grey small" id="mod_top">置顶</button>
		<button class="grey small" id="mod_move">移动</button>
		<button class="grey small" id="mod_delete">删除</button>
	</dt>
	<dt class="right col-4">
		<label>全选<input type="checkbox" name="checkall" id="threadlist_checkall" value="" />&nbsp;</label>
	</dt>
</dl>
<? } ?>


<div class="panel">
	<div class="header">站点统计</div>
	<div class="body">
		<div>
			<i>主题数：</i><b><?=$runtime['threads']?></b>  　
			<i>帖子数：</i><b><?=$runtime['posts']?></b>  　
			<i>用户数：</i><b><?=$runtime['users']?></b>  　
			<i>今日回帖数：</i><b class="blue"><?=$runtime['todayposts']?></b>  　
			<i>今日主题数：</i><b class="blue"><?=$runtime['todaythreads']?></b>  　
			<i>今日新用户：</i><b class="blue"><?=$runtime['todayusers']?></b>  　
			<? if(!$onlinelist) { ?> <i>在线：</i><b class="blue"><?=$runtime['onlines']?></b> <? } ?>
		</div>
	</div>
</div>

<? if($linklist) { ?>
<div class="panel">
	<div class="header">友情链接</div>
	<div class="body">
		<? foreach ($linklist as $link) { ?>
		<a href="<?=$link['url']?>" target="_blank"><?=$link['name']?></a>　
		<? } ?>
	</div>
</div>
<? } ?>

<? if($onlinelist) { ?>
<div class="panel">
	<div class="header">在线 (<?=$runtime['onlines']?>人)</div>
	<div class="body">
	<? foreach ($onlinelist as $online) { ?>
		<? if($online['uid']) { ?>
		<a href="user-<?=$online['uid']?>.htm" target="_blank" <? if($gid == 1) { ?>title="IP:<?=long2ip($online['ip'])?>" <? }?> ><?=$online['username']?></a>　
		<? } else {?>
		<span <? if($gid == 1) { ?>title="IP:<?=long2ip($online['ip'])?>" <? }?> >游客</span>　
		<? } ?>
	<? } ?>
	
	</div>
</div>
<? } ?>

<? include "./pc/view/footer.inc.htm"; ?>

<script>
render_threadlist();
thread_list_script();
forumlist_active(fid);
document_scroll_top();
</script>